<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - Styling Buttons</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/fonts/fonts-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<h1>inputEx - Styling Buttons</h1>


<!-- Example 1 -->
<div class='exampleDiv'>

	<h2>Styling the buttons</h2>
	
	<p>Let's add a different background on buttons</p>

	<div class='demoContainer' id='container1'></div>

	<style>
	   
   a.inputEx-Button {
      /* Sliding right image */
      background: transparent url('assets/images/button_right.png') no-repeat scroll top right; 
      display: block;
      float: left;
      height: 34px; /* CHANGE THIS VALUE ACCORDING TO IMAGE HEIGHT */
      margin-right: 6px;
      padding-right: 20px; /* CHANGE THIS VALUE ACCORDING TO RIGHT IMAGE WIDTH */
      text-decoration: none;
      color: #000000;
      font-family: Arial, Helvetica, sans-serif;
      font-size:12px;
      font-weight:bold;
      cursor:pointer;
   }
   a.inputEx-Button span {
      /* Background left image */ 
      background: transparent url('assets/images/button_left.png') no-repeat; 
      display: block;
      line-height: 22px; /* CHANGE THIS VALUE ACCORDING TO BUTTON HEIGHT */
      padding: 7px 0 5px 18px;
      cursor:pointer;
   } 
   a.inputEx-Button:hover span{
      text-decoration:underline;
   }

	</style>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
		   
		   /*******************************
		   * JS
		   *******************************/
      	var form = new inputEx.Form({
      	   id:'sampleForm', 
      	   parentEl: 'container1', 
      	   fields: descriptedFields, 
      	   legend: 'User Informations',
      	   buttons:[
      	      /*
      	      *
      	      * Note that we use "type:'submit-link'" or "type:'link'" buttons here because they
      	      * are rendered with a different DOM that is easier to style in a cross-browser way
      	      * than "type:'submit'" (<input type="submit" />).
      	      *
      	      */
      	      {type: 'submit-link', value: 'Submit Form'},  /* classic form submit triggered, as with type:'submit' */
      	      {type: 'link', value: 'Cancel', onClick:function(e) {form.clear();} /* reset inputEx form */
      	   ]
      	});
   
		   /*******************************
		   * CSS
		   *******************************/
         a.inputEx-Button {
            /* Sliding right image */
            background: transparent url('assets/images/button_right.png') no-repeat scroll top right; 
            display: block;
            float: left;
            height: 34px; /* CHANGE THIS VALUE ACCORDING TO IMAGE HEIGHT */
            margin-right: 6px;
            padding-right: 20px; /* CHANGE THIS VALUE ACCORDING TO RIGHT IMAGE WIDTH */
            text-decoration: none;
            color: #000000;
            font-family: Arial, Helvetica, sans-serif;
            font-size:12px;
            font-weight:bold;
            cursor:pointer;
         }
         a.inputEx-Button span {
            /* Background left image */ 
            background: transparent url('assets/images/button_left.png') no-repeat; 
            display: block;
            line-height: 22px; /* CHANGE THIS VALUE ACCORDING TO BUTTON HEIGHT */
            padding: 7px 0 5px 18px;
            cursor:pointer;
         } 
         a.inputEx-Button:hover span{
            text-decoration:underline;
         }
		</textarea>
	</div>

</div>




<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../lib/yui/selector/selector-min.js"></script>
<script type="text/javascript" src="../lib/yui/event-delegate/event-delegate-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/mixins/choice.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/Group.js"  type='text/javascript'></script>
<script src="../js/widgets/Button.js"  type='text/javascript'></script>
<script src="../js/Form.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/SelectField.js"  type='text/javascript'></script>
<script src="../js/fields/EmailField.js"  type='text/javascript'></script>
<script src="../js/fields/UrlField.js"  type='text/javascript'></script>
<script src="../js/fields/CheckBox.js"  type='text/javascript'></script>
<script src="../js/fields/RadioField.js"  type='text/javascript'></script>
<script src="../js/fields/Textarea.js"  type='text/javascript'></script>

<script>

YAHOO.util.Event.addListener(window, 'load', function() {
	
	// Required for the UrlField
	inputEx.spacerUrl = "../images/space.gif";
	
	// Example 1
	var descriptedFields = [ 
			{type: 'select', label: 'A select', choices: ['One','Two','Three'], value:"One" },
			{label: 'StringField', value:'Jacques', required:true },
			{type: 'boolean', label: 'Happy to be there ?', name: 'happy'},
			{ type: 'radio', label: 'Radio', name: 'example1', choices: ['Ajaxian','YUI blog','other']}
	];
	
	form = new inputEx.Form({
	   id:'sampleForm', 
	   parentEl: 'container1', 
	   fields: descriptedFields, 
	   legend: 'User Informations',
	   buttons:[
	      {type: 'submit-link', value: 'Submit Form'},
	      {type: 'link', value: 'Cancel', onClick:function(e) {form.clear();}}
	   ]
	});
	
	
});	

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

<br /><br />
<p style="margin-left:20px">CSS Credits : <a href="http://www.jankoatwarpspeed.com/post/2008/04/30/make-fancy-buttons-using-css-sliding-doors-technique.aspx" target="_new">http://www.jankoatwarpspeed.com/post/2008/04/30/make-fancy-buttons-using-css-sliding-doors-technique.aspx</a></p>
<br />

 </body>
</html>